package com.tsy.videodemo.jiaozi;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.bumptech.glide.Glide;
import com.tsy.videodemo.R;

import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;

public class JiaoZiActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_jiaozi);
        JzvdStd jzvdStd = (JzvdStd) findViewById(R.id.jz_video);
        jzvdStd.setUp("https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0200fg10000c2av6pt4onp9d9jv19bg&ratio=720p&line=0"
                , "饺子闭眼睛");
        Glide.with(this).load("http://p.qpic.cn/videoyun/0/2449_43b6f696980311e59ed467f22794e792_1/640").into(jzvdStd.posterImageView);
    }

    @Override
    public void onBackPressed() {
        if (Jzvd.backPress()) {
            return;
        }
        super.onBackPressed();
    }
    @Override
    protected void onPause() {
        super.onPause();
        Jzvd.releaseAllVideos();
    }
}
